<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>土豆网案例</title>
    <style>
        /* 原来有一个黑色半透明的盒子没有显示出来，当鼠标经过的时候盒子显现出来的效果 */
        .tudou {
            position: relative;
            width: 444px;
            height: 320px;
            background-color: whitesmoke;
            margin: 0 auto;
        }

        .tudou img {
            width: 100%;
            height: 100%;
        }

        .mask {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            /* background-color: rgba(0, 0, 0, .3);
            background-image: url(images/arr.png);
            background-repeat: no-repeat;
            background-position: center; */
            /* 布局 */
            background: rgba(0, 0, 0, .3) url(images/arr.png) no-repeat center;
            /* 既能隐藏，又不会占有原来的位置用display */
            display: none;
        }

        /* 当鼠标经过土豆图片时，让mask显示出来 */
        .tudou:hover .mask {
            display: block;
        }
    </style>
</head>

<body>
    <div class="tudou">
        <div class="mask"></div>
        <img src="images/tudou.jpg" alt="">
    </div>
</body>

</html>